Optimal. Leaf size=199 \[ -\frac {(a d (2-n)+b c (2+n)) (a+b x)^{1+n} (c+d x)^{1-n}}{6 b^2 d^2}+\frac {x (a+b x)^{1+n} (c+d x)^{1-n}}{3 b d}+\frac {\left (2 a b c d \left (1-n^2\right )+a^2 d^2 \left (2-3 n+n^2\right )+b^2 c^2 \left (2+3 n+n^2\right )\right ) (a+b x)^{1+n} (c+d x)^{-n} \left (\frac {b (c+d x)}{b c-a d}\right )^n \, _2F_1\left (n,1+n;2+n;-\frac {d (a+b x)}{b c-a d}\right )}{6 b^3 d^2 (1+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 199, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {92, 81, 72, 71}
\begin {gather*} \frac {(a+b x)^{n+1} (c+d x)^{-n} \left (a^2 d^2 \left (n^2-3 n+2\right )+2 a b c d \left (1-n^2\right )+b^2 c^2 \left (n^2+3 n+2\right )\right ) \left (\frac {b (c+d x)}{b c-a d}\right )^n \, _2F_1\left (n,n+1;n+2;-\frac {d (a+b x)}{b c-a d}\right )}{6 b^3 d^2 (n+1)}-\frac {(a+b x)^{n+1} (c+d x)^{1-n} (a d (2-n)+b c (n+2))}{6 b^2 d^2}+\frac {x (a+b x)^{n+1} (c+d x)^{1-n}}{3 b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 71
Rule 72
Rule 81
Rule 92
Rubi steps
\begin {align*} \int x^2 (a+b x)^n (c+d x)^{-n} \, dx &=\frac {x (a+b x)^{1+n} (c+d x)^{1-n}}{3 b d}+\frac {\int (a+b x)^n (c+d x)^{-n} (-a c-(a d (2-n)+b c (2+n)) x) \, dx}{3 b d}\\ &=-\frac {(a d (2-n)+b c (2+n)) (a+b x)^{1+n} (c+d x)^{1-n}}{6 b^2 d^2}+\frac {x (a+b x)^{1+n} (c+d x)^{1-n}}{3 b d}+\frac {\left (2 a b c d \left (1-n^2\right )+a^2 d^2 \left (2-3 n+n^2\right )+b^2 c^2 \left (2+3 n+n^2\right )\right ) \int (a+b x)^n (c+d x)^{-n} \, dx}{6 b^2 d^2}\\ &=-\frac {(a d (2-n)+b c (2+n)) (a+b x)^{1+n} (c+d x)^{1-n}}{6 b^2 d^2}+\frac {x (a+b x)^{1+n} (c+d x)^{1-n}}{3 b d}+\frac {\left (\left (2 a b c d \left (1-n^2\right )+a^2 d^2 \left (2-3 n+n^2\right )+b^2 c^2 \left (2+3 n+n^2\right )\right ) (c+d x)^{-n} \left (\frac {b (c+d x)}{b c-a d}\right )^n\right ) \int (a+b x)^n \left (\frac {b c}{b c-a d}+\frac {b d x}{b c-a d}\right )^{-n} \, dx}{6 b^2 d^2}\\ &=-\frac {(a d (2-n)+b c (2+n)) (a+b x)^{1+n} (c+d x)^{1-n}}{6 b^2 d^2}+\frac {x (a+b x)^{1+n} (c+d x)^{1-n}}{3 b d}+\frac {\left (2 a b c d \left (1-n^2\right )+a^2 d^2 \left (2-3 n+n^2\right )+b^2 c^2 \left (2+3 n+n^2\right )\right ) (a+b x)^{1+n} (c+d x)^{-n} \left (\frac {b (c+d x)}{b c-a d}\right )^n \, _2F_1\left (n,1+n;2+n;-\frac {d (a+b x)}{b c-a d}\right )}{6 b^3 d^2 (1+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.14, size = 154, normalized size = 0.77 \begin {gather*} \frac {(a+b x)^{1+n} (c+d x)^{-n} \left (b (a d (-2+n)-b c (2+n)) (c+d x)+2 b^2 d x (c+d x)+\frac {\left (-2 a b c d \left (-1+n^2\right )+a^2 d^2 \left (2-3 n+n^2\right )+b^2 c^2 \left (2+3 n+n^2\right )\right ) \left (\frac {b (c+d x)}{b c-a d}\right )^n \, _2F_1\left (n,1+n;2+n;\frac {d (a+b x)}{-b c+a d}\right )}{1+n}\right )}{6 b^3 d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.02, size = 0, normalized size = 0.00 \[\int x^{2} \left (b x +a \right )^{n} \left (d x +c \right )^{-n}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: HeuristicGCDFailed} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {x^2\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________